package com.wnxy.system.controller;

import com.wnxy.system.entity.Subject;
import com.wnxy.system.service.SubjectService;
import com.wnxy.system.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/subject")
public class SubjectController {
    @Autowired
    private SubjectService subjectService;

    @PostMapping
    public PageVo<Subject> findByPage(@RequestBody Map<String,Object> map) {
        PageVo<Subject> pageVo = subjectService.findByPage(map);
        return pageVo;
    }

    @DeleteMapping("/del/batch")
    public void deleteBatch(@RequestBody List<String> ids) {
        subjectService.removeBatchByIds(ids);
    }

    @DeleteMapping("/del/batch2")
    public void deleteBatch2(@RequestBody List<String> ids) {
        subjectService.delBatch(ids);
    }
}
